package marchsoft.modules.four.h5.mapper;

import marchsoft.base.BasicMapper;
import marchsoft.modules.four.common.entity.PracticeRecord;
import marchsoft.modules.four.common.entity.SafeType;
import marchsoft.modules.four.common.entity.Repository;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;
import java.util.List;


@Component
public interface RepositoryMapper extends BasicMapper<PracticeRecord> {

    //前台获取所有安全分类
    @Select("select * from e_safe_type")
    List<SafeType> select();

    //按照分类id获取相应的题库
    @Select("select * from e_repository where safe_type_id = #{id}")
    List<Repository> selectRepositoryById(Integer id);

    //新增练习记录，修改练习记录
    @Select("select * from e_practice_record where user_id=#{userId}")
    List<PracticeRecord> selectAllRecord(Integer userId);




}
